<nz-modal [(nzVisible)]="visible" [nzTitle]="modalTitle" [nzContent]="modalContent" [nzFooter]="modalFooter" [nzMaskClosable]="false" [nzWidth]="600" (nzOnCancel)="hide()">
    <form #myForm="ngForm" role="form">
        <ng-template #modalTitle>
            学生信息
        </ng-template>

        <ng-template #modalContent>
            <div class="grid-auto-row" *ngIf="object">
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="name">姓名</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="name" type="text" [(ngModel)]="object.name" required>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="code">学号</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="code" type="text" [(ngModel)]="object.code">
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="level">年级</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                        <nz-select name="level" [(ngModel)]="object.level" required>
                            <nz-option [nzValue]="2018" nzLabel="2018"></nz-option>
                            <nz-option [nzValue]="2019" nzLabel="2019"></nz-option>
                            <nz-option [nzValue]="2020" nzLabel="2020"></nz-option>
                        </nz-select>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="email">邮箱</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="email" type="text" [(ngModel)]="object.email">
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="mobile">电话</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="mobile" type="text" [(ngModel)]="object.mobile">
                    </nz-form-control>
                </nz-form-item>
            </div>
        </ng-template>

        <ng-template #modalFooter>
            <button nz-button nzType="default" (click)="hide()">取消</button>
            <button nz-button nzType="primary" (click)="submit()" [disabled]="!myForm.form.valid">保存</button>
        </ng-template>
    </form>
</nz-modal>
